#include    <stdio.h>
#include    <string.h>
#include    "regex.h"

int main(int argc, char *argv[])
{
        char *str="b(cd)+";
	struct dfa *dfa;
	char *p;
	struct nfa *nfa = nfa_compile(str);
	
	nfa_printf(nfa);

	dfa = nfa_to_dfa(nfa);
	dfa_printf(dfa);

	p = regex_match(dfa,"assbd");
	if(p != NULL)
		printf("result 1: %s\n",p);
	p = regex_match(dfa,"bbc");
	if(p != NULL)
		printf("result 2: %s\n",p);
	p = regex_match(dfa,"abc");
	if(p != NULL)
		printf("result 3: %s\n",p);
	return 0;
}
